﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Marmat.Foundation
{
    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="Entity"></typeparam>
    /// <typeparam name="DataSource"></typeparam>
    public interface ISelectionRecordForm<Entity, DataSource> : IBasicSelectionRecordForm<Entity, DataSource>
    {
        /// <summary>
        /// 显示选择记录的窗体。
        /// </summary>
        /// <param name="result">表示用户选择的数据。</param>
        /// <returns>当用户选择某数据并确认后，返回 true。反之，返回false。</returns>
        bool ShowDialog(out Entity result);

        /// <summary>
        /// 数据验证
        /// </summary>
        Func<Entity, bool> Verify { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public interface ISelectionRecordForm: ISelectionRecordForm<System.Data.DataRow, System.Data.DataTable>
    {
    }

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="Entity"></typeparam>
    public interface ISelectionRecordForm<Entity> : ISelectionRecordForm<Entity, IEnumerable<Entity>>
    {
    }
}
